package com.hanlink.dsp.bluetooth.ble;

import com.inuker.bluetooth.library.connect.options.BleConnectOptions;
import com.inuker.bluetooth.library.connect.response.BleConnectResponse;
import com.inuker.bluetooth.library.search.SearchRequest;
import com.inuker.bluetooth.library.search.response.SearchResponse;

public class BtHelper {

    public void connectLeDevice(String mac, String paramString2, BleConnectResponse paramBleConnectResponse) {
        BleConnectOptions options = new BleConnectOptions.Builder().setConnectRetry(2).setConnectTimeout(20000).setServiceDiscoverRetry(2).setServiceDiscoverTimeout(10000).build();
        ClientManager.getClient().connect(mac, options, paramBleConnectResponse);
    }

    public void disconnect(String paramString) {
        ClientManager.getClient().disconnect(paramString);
    }

    public void searchBleDevice(SearchResponse paramSearchResponse) {
        SearchRequest localSearchRequest = new SearchRequest.Builder().searchBluetoothLeDevice(20000, 2).build();
        ClientManager.getClient().search(localSearchRequest, paramSearchResponse);
    }

    public void searchClassicDevice(SearchResponse paramSearchResponse) {
        SearchRequest localSearchRequest = new SearchRequest.Builder().searchBluetoothClassicDevice(20000, 2).build();
        ClientManager.getClient().search(localSearchRequest, paramSearchResponse);
    }

    public void stopSearch() {
        ClientManager.getClient().stopSearch();
    }
}
